<template>
  <div class="app-container">
    <tbody>
    <tr style="height:28.35pt">
      <td
        style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-left-color:#000000; border-left-style:solid; border-left-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.03pt; padding-right:5.03pt; vertical-align:middle">
        <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span
          style="font-family:宋体; font-size:10.5pt; font-weight:bold">第一部分：废物产生单位填写</span></p></td>
      <td rowspan="7"
          style="border-bottom-color:#ffffff; border-bottom-style:solid; border-bottom-width:0.75pt; border-left-color:#000000; border-left-style:solid; border-left-width:0.75pt; border-right-color:#ffffff; border-right-style:solid; border-right-width:0.75pt; border-top-color:#ffffff; border-top-style:solid; border-top-width:0.75pt; padding-left:5.03pt; padding-right:5.03pt; vertical-align:middle">
<!--        <p style="margin:5pt 0pt; text-align:center"><span style="font-family:宋体; font-size:10.5pt">第一联</span></p>-->
<!--        <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style="font-family:宋体; font-size:10.5pt">产生单位</span>-->
        </p></td>
    </tr>
    <tr>
      <td
        style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-left-color:#000000; border-left-style:solid; border-left-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.03pt; padding-right:5.03pt; vertical-align:top">
        <p style="line-height:12pt; margin:5pt 0pt"><span style="font-family:宋体; font-size:9pt">&nbsp;</span></p>
        <p style="line-height:12pt; margin:5pt 0pt"><span style="font-family:宋体; font-size:10.5pt">产生单位</span><span
          style="font-family:宋体; font-size:10.5pt">_________________________________单位盖章 </span><span
          style="font-family:宋体; font-size:10.5pt">&nbsp;&nbsp; </span><span style="font-family:宋体; font-size:10.5pt">电话________________</span>
        </p>
        <p style="line-height:13pt; margin:5pt 0pt"><span style="font-family:宋体; font-size:10.5pt">通讯地址</span><span
          style="font-family:宋体; font-size:10.5pt"> ___________________________________________ 邮编________________</span>
        </p>
        <p style="line-height:13pt; margin:5pt 0pt"><span style="font-family:宋体; font-size:10.5pt">运输单位</span><span
          style="font-family:宋体; font-size:10.5pt"> ____________________________________________ 电话_______________</span>
        </p>
        <p style="line-height:13pt; margin:5pt 0pt"><span style="font-family:宋体; font-size:10.5pt">通讯地址</span><span
          style="font-family:宋体; font-size:10.5pt"> ____________________________________________ 邮编_______________</span>
        </p>
        <p style="line-height:13pt; margin:5pt 0pt"><span style="font-family:宋体; font-size:10.5pt">接受单位</span><span
          style="font-family:宋体; font-size:10.5pt"> ____________________________________________ 电话________________</span>
        </p>
        <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style="font-family:宋体; font-size:10.5pt">通讯地址</span><span
          style="font-family:宋体; font-size:10.5pt"> </span><span
          style="font-family:'Times New Roman'; font-size:10.5pt">_____________________________________________</span><span
          style="font-family:宋体; font-size:10.5pt">邮编</span><span
          style="font-family:'Times New Roman'; font-size:10.5pt">________________</span></p></td>
    </tr>
    <tr>
      <td
        style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-left-color:#000000; border-left-style:solid; border-left-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.03pt; padding-right:5.03pt; vertical-align:top">
        <p style="line-height:13pt; margin:5pt 0pt"><span style="font-family:宋体; font-size:10.5pt">&nbsp;</span></p>
        <p style="line-height:13pt; margin:5pt 0pt"><span style="font-family:宋体; font-size:10.5pt">废物名称</span><span
          style="font-family:宋体; font-size:10.5pt"> __________________类别编号__________________ 数量________________</span>
        </p>
        <p style="line-height:13pt; margin:5pt 0pt"><span style="font-family:宋体; font-size:10.5pt">废物特性：</span><span
          style="font-family:宋体; font-size:10.5pt">__________________ 形态 ________________ 包装方式______________</span></p>
        <p style="line-height:13pt; margin:5pt 0pt"><span style="font-family:宋体; font-size:10.5pt">外运目的：中转贮存</span><span
          style="font-family:宋体; font-size:10.5pt"> 利用 处理 处置 </span></p>
        <p style="line-height:13pt; margin:5pt 0pt"><span style="font-family:宋体; font-size:10.5pt">主要危险成分</span><span
          style="font-family:宋体; font-size:10.5pt"> _________________________禁忌与应急措施 _____________________</span></p>
        <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style="font-family:宋体; font-size:10.5pt">发运人</span><span
          style="font-family:宋体; font-size:10.5pt"> </span><span
          style="font-family:'Times New Roman'; font-size:10.5pt">_____________ </span><span
          style="font-family:宋体; font-size:10.5pt">运达地 </span><span
          style="font-family:'Times New Roman'; font-size:10.5pt">______________ </span><span
          style="font-family:宋体; font-size:10.5pt">转移时间</span><span
          style="font-family:'Times New Roman'; font-size:10.5pt">________</span><span
          style="font-family:宋体; font-size:10.5pt">年</span><span
          style="font-family:'Times New Roman'; font-size:10.5pt">____ </span><span
          style="font-family:宋体; font-size:10.5pt">月</span><span
          style="font-family:'Times New Roman'; font-size:10.5pt">____</span><span
          style="font-family:宋体; font-size:10.5pt">日</span></p></td>
    </tr>
    <tr style="height:28.35pt">
      <td
        style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-left-color:#000000; border-left-style:solid; border-left-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.03pt; padding-right:5.03pt; vertical-align:middle">
        <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span
          style="font-family:宋体; font-size:10.5pt; font-weight:bold">第二部分：废物运输单位填写</span></p></td>
    </tr>
    <tr>
      <td
        style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-left-color:#000000; border-left-style:solid; border-left-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.03pt; padding-right:5.03pt; vertical-align:top">
        <p style="line-height:13pt; margin:5pt 0pt"><span style="font-family:宋体; font-size:10.5pt">运输者须知：你必须核对以上栏目事项，当与实际情况不符时，有权拒绝接受。</span>
        </p>
        <p style="line-height:13pt; margin:5pt 0pt"><span style="font-family:宋体; font-size:10.5pt">第一承运人</span><span
          style="font-family:宋体; font-size:10.5pt"> ________________________________运输日期________年____月____日</span></p>
        <p style="line-height:13pt; margin:5pt 0pt"><span style="font-family:宋体; font-size:10.5pt">车（船）型：</span><span
          style="font-family:宋体; font-size:10.5pt">________________ 牌号________________道路运输证号_____________</span></p>
        <p style="line-height:13pt; margin:5pt 0pt"><span style="font-family:宋体; font-size:10.5pt">运输起点</span><span
          style="font-family:宋体; font-size:10.5pt">__________经由地___________运输终点___________ 运输人签字_________</span></p>
        <p style="line-height:13pt; margin:5pt 0pt"><span style="font-family:宋体; font-size:10.5pt">第二承运人</span><span
          style="font-family:宋体; font-size:10.5pt"> _______________________运输日期______年__月__日</span></p>
        <p style="line-height:13pt; margin:5pt 0pt"><span style="font-family:宋体; font-size:10.5pt">车（船）型：</span><span
          style="font-family:宋体; font-size:10.5pt">________________牌号_________________道路运输证号_____________</span></p>
        <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span style="font-family:宋体; font-size:10.5pt">运输起点</span><span
          style="font-family:'Times New Roman'; font-size:10.5pt">________</span><span
          style="font-family:宋体; font-size:10.5pt">经由地</span><span
          style="font-family:'Times New Roman'; font-size:10.5pt">_________</span><span
          style="font-family:宋体; font-size:10.5pt">运输终点</span><span
          style="font-family:'Times New Roman'; font-size:10.5pt">___________ </span><span
          style="font-family:宋体; font-size:10.5pt">运输人签字</span><span
          style="font-family:'Times New Roman'; font-size:10.5pt">_____________</span></p></td>
    </tr>
    <tr style="height:28.35pt">
      <td
        style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-left-color:#000000; border-left-style:solid; border-left-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.03pt; padding-right:5.03pt; vertical-align:middle">
        <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span
          style="font-family:宋体; font-size:10.5pt; font-weight:bold">第三部分：废物接受单位填写</span></p></td>
    </tr>
    <tr>
      <td
        style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; border-left-color:#000000; border-left-style:solid; border-left-width:0.75pt; border-right-color:#000000; border-right-style:solid; border-right-width:0.75pt; border-top-color:#000000; border-top-style:solid; border-top-width:0.75pt; padding-left:5.03pt; padding-right:5.03pt; vertical-align:top">
        <p style="line-height:13pt; margin:5pt 0pt"><span style="font-family:宋体; font-size:10.5pt">接受者须知：你必须核实以上栏目内容，当与实际情况不符时，有权拒绝接受。</span>
        </p>
        <p style="line-height:13pt; margin:5pt 0pt"><span style="font-family:宋体; font-size:10.5pt">经营许可证号</span><span
          style="font-family:宋体; font-size:10.5pt">__________________接收人 ____________ 接收日期 ______________</span></p>
        <p style="line-height:13pt; margin:5pt 0pt"><span
          style="font-family:宋体; font-size:10.5pt">废物处置方式：利用□ </span><span
          style="font-family:宋体; font-size:10.5pt">贮存</span><span style="font-family:宋体; font-size:10.5pt">□</span><span
          style="font-family:宋体; font-size:10.5pt"> 焚烧</span><span
          style="font-family:宋体; font-size:10.5pt">□</span><span
          style="font-family:宋体; font-size:10.5pt"> 安全填埋</span><span
          style="font-family:宋体; font-size:10.5pt">□</span><span
          style="font-family:宋体; font-size:10.5pt"> 其他</span><span style="font-family:宋体; font-size:10.5pt">□</span></p>
        <p style="margin:0pt; orphans:0; text-align:justify; widows:0"><span
          style="font-family:宋体; font-size:10.5pt; font-weight:normal">单位负责人签字</span><span
          style="font-family:'Times New Roman'; font-size:10.5pt; font-weight:normal">__________________________ </span><span
          style="font-family:宋体; font-size:10.5pt; font-weight:normal">单位盖章 </span><span
          style="font-family:宋体; font-size:10.5pt; font-weight:normal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
          style="font-family:宋体; font-size:10.5pt; font-weight:normal">日期</span><span
          style="font-family:'Times New Roman'; font-size:10.5pt; font-weight:normal">_____________</span></p></td>
    </tr>
    </tbody>
    <!--    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
          <el-form-item label="产废企业名称" prop="cftzEpName">
            <el-input
              v-model="queryParams.cftzEpName"
              placeholder="请输入产废企业名称"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="产废口编号" prop="cftzCode">
            <el-input
              v-model="queryParams.cftzCode"
              placeholder="请输入产废口编号"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="视频" prop="cftzVideo">
            <el-input
              v-model="queryParams.cftzVideo"
              placeholder="请输入视频"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="危险废物名称" prop="cftzWxfwName">
            <el-input
              v-model="queryParams.cftzWxfwName"
              placeholder="请输入危险废物名称"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="种类" prop="cftzType">
            <el-select v-model="queryParams.cftzType" placeholder="请选择种类" clearable size="small">
              <el-option label="请选择字典生成" value="" />
            </el-select>
          </el-form-item>
          <el-form-item label="危险特性" prop="cftzTx">
            <el-input
              v-model="queryParams.cftzTx"
              placeholder="请输入危险特性"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="数量" prop="cftzNum">
            <el-input
              v-model="queryParams.cftzNum"
              placeholder="请输入数量"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="流向" prop="cftzLx">
            <el-input
              v-model="queryParams.cftzLx"
              placeholder="请输入流向"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="登记日期" prop="cftzTime">
            <el-input
              v-model="queryParams.cftzTime"
              placeholder="请输入登记日期"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
          </el-form-item>
        </el-form>-->

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="small"
          @click="handleAdd"
          v-hasPermi="['solidProdution:cftzInfo:add']"
        >新增
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="small"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['solidProdution:cftzInfo:edit']"
        >修改
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="small"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['solidProdution:cftzInfo:remove']"
        >删除
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="small"
          :loading="exportLoading"
          @click="handleExport"
          v-hasPermi="['solidProdution:cftzInfo:export']"
        >导出
        </el-button>

      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="small"
          :loading="exportLoading"
          @click="print"

        >打印
        </el-button>

      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="cftzInfoList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center"/>
      <!--      <el-table-column label="产废台账ID" align="center" prop="cftzId" />-->
      <el-table-column label="产废企业名称" align="center" prop="cftzEpName"/>
      <!--      <el-table-column label="产废口编号" align="center" prop="cftzCode" />-->
      <!--      <el-table-column label="视频" align="center" prop="cftzVideo" />-->
      <el-table-column label="危险废物名称" align="center" prop="cftzWxfwName"/>
      <el-table-column :formatter="typeFormat" label="种类" align="center" prop="cftzType"/>
      <el-table-column :formatter="typeFormat_tx" label="危险特性" align="center" prop="cftzTx"/>
      <el-table-column label="数量" align="center" prop="cftzNum"/>
      <!--      <el-table-column label="流向" align="center" prop="cftzLx" />-->
      <el-table-column label="登记日期" align="center" prop="cftzTime"/>
      <!--      <el-table-column label="备注" align="center" prop="remark" />
            <el-table-column label="冗余字段" align="center" prop="other" />
            <el-table-column label="冗余字段" align="center" prop="otherOne" />-->
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="small"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['solidProdution:cftzInfo:edit']"
          >修改
          </el-button>
          <el-button
            size="small"
            @click="handleDelete(scope.row)"
            v-hasPermi="['solidProdution:cftzInfo:remove']"
          >删除
          </el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改产废台账对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" class="clearfix " label-width="140px">
        <el-form-item label="产废企业名称" prop="cftzEpName">
          <el-input v-model="form.cftzEpName" placeholder="请输入产废企业名称"/>
        </el-form-item>
        <el-form-item label="产废口编号" prop="cftzCode">
          <el-input v-model="form.cftzCode" placeholder="请输入产废口编号"/>
        </el-form-item>
        <el-form-item label="视频" prop="cftzVideo">
          <VideoUpload v-model="form.cftzVideo" placeholder="请输入视频"/>
        </el-form-item>
        <el-form-item label="危险废物名称" prop="cftzWxfwName">
          <el-input v-model="form.cftzWxfwName" placeholder="请输入危险废物名称"/>
        </el-form-item>
        <el-form-item label="种类" prop="cftzType">
          <el-select v-model="form.cftzType" placeholder="请选择">
            <el-option
              v-for="dict in typeOptions"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="危险特性" prop="cftzTx">
          <el-select v-model="form.cftzTx" placeholder="请选择">
            <el-option
              v-for="dict in typeOptions_tx"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="产生数量" prop="cftzNum">
          <el-input v-model="form.cftzNum" type="number" placeholder="请输入数量"/>
        </el-form-item>
        <el-form-item label="贮存数量" prop="remark">
          <el-input v-model="form.remark" type="number" placeholder="请输入贮存数量"/>
        </el-form-item>
        <el-form-item label="利用数量" prop="other">
          <el-input v-model="form.other" type="number" placeholder="请输入利用数量"/>
        </el-form-item>
        <el-form-item label="处置数量" prop="otherOne">
          <el-input v-model="form.otherOne" type="number" placeholder="请输入处置数量"/>
        </el-form-item>
        <el-form-item label="流向" prop="cftzLx">
          <el-select v-model="form.cftzLx" placeholder="请选择">
            <el-option
              v-for="dict in typeOptions_lx"
              :key="dict.dictValue"
              :label="dict.dictLabel"
              :value="dict.dictValue"
            ></el-option>
          </el-select>
          <!--          <el-input v-model="form.cftzLx" placeholder="请输入流向" />-->
        </el-form-item>

        <!--        <el-form-item label="删除标志" prop="delFlag">-->
        <!--          <el-input v-model="form.delFlag" placeholder="请输入删除标志" />-->
        <!--        </el-form-item>-->

        <el-form-item label="登记日期" prop="cftzTime">
          <el-date-picker v-model="form.cftzTime" clearable
                          placeholder="选择登记日期"
                          size="small"
                          style="width:100%"
                          type="date"
                          value-format="yyyy-MM-dd">
          </el-date-picker>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer tianjie_button" style="text-align: center; margin-top:30px">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {
  addCftzInfo,
  delCftzInfo,
  exportCftzInfo,
  getCftzInfo,
  listCftzInfo,
  updateCftzInfo
} from "@/api/solidProdution/cftzInfo";


export default {
  name: "CftzInfo",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 产废台账表格数据
      cftzInfoList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        cftzEpName: null,
        cftzCode: null,
        cftzVideo: null,
        cftzWxfwName: null,
        cftzType: null,
        cftzTx: null,
        cftzNum: null,
        cftzLx: null,
        cftzTime: null,
        other: null,
        otherOne: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        cftzEpName: [
          {required: true, message: "名称不能为空", trigger: "blur"}
        ]
      },
      typeOptions: [],
      typeOptions_tx: [],
      typeOptions_lx: [],
    };
  },
  created() {
    this.getDicts("wxfwxt").then(response => {
      this.typeOptions = response.data;
    });
    this.getDicts("wxtx").then(response => {
      this.typeOptions_tx = response.data;
    });
    this.getDicts("lx").then(response => {
      this.typeOptions_lx = response.data;
    });
    this.getList();
  },
  methods: {
    print(){
       window.print()
     },
    typeFormat(row, column) {
      return this.selectDictLabel(this.typeOptions, row.cftzType);
    },
    typeFormat_tx(row, column) {
      return this.selectDictLabel(this.typeOptions_tx, row.cftzTx);
    },
    /** 查询产废台账列表 */
    getList() {
      this.loading = true;
      listCftzInfo(this.queryParams).then(response => {
        this.cftzInfoList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        cftzId: null,
        cftzEpName: null,
        cftzCode: null,
        cftzVideo: null,
        cftzWxfwName: null,
        cftzType: null,
        cftzTx: null,
        cftzNum: null,
        cftzLx: null,
        cftzTime: null,
        delFlag: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        remark: null,
        other: null,
        otherOne: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.cftzId)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加产废台账";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const cftzId = row.cftzId || this.ids
      getCftzInfo(cftzId).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改产废台账";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.cftzId != null) {
            updateCftzInfo(this.form).then(response => {
              this.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addCftzInfo(this.form).then(response => {
              this.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const cftzIds = row.cftzId || this.ids;
      this.$confirm('是否确认删除产废台账编号为"' + cftzIds + '"的数据项?', "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(function () {
        return delCftzInfo(cftzIds);
      }).then(() => {
        this.getList();
        this.msgSuccess("删除成功");
      }).catch(() => {
      });
    },
    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams;
      this.$confirm('是否确认导出所有产废台账数据项?', "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        this.exportLoading = true;
        return exportCftzInfo(queryParams);
      }).then(response => {
        this.download(response.msg);
        this.exportLoading = false;
      }).catch(() => {
      });
    }
  }
};
</script>
